/* 全局重置和基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body,
#root {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: rgba(0, 0, 0, 0.88);
  line-height: 1.5;
  background-color: #f5f5f5;
}

/* 布局样式 */
.ant-layout {
  min-height: 100vh;
  background-color: #f5f5f5;
}

/* 侧边栏样式 */
.ant-layout-sider {
  box-shadow: 2px 0 8px 0 rgba(29, 35, 41, 0.05);
  z-index: 10;

  .ant-menu {
    border-right: 0;
  }

  .ant-menu-item {
    margin: 4px 0;
    border-radius: 4px;
    width: calc(100% - 8px);
    margin-left: 4px;

    &:hover {
      background-color: rgba(0, 0, 0, 0.06);
    }
  }

  .ant-menu-item-selected {
    background-color: #e6f4ff;
    color: #1677ff;
    font-weight: 500;
  }
}

/* 顶部导航样式 */
.ant-layout-header {
  padding: 0;
  height: 64px;
  line-height: 64px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
  z-index: 9;
  display: flex;
  align-items: center;
}

/* 内容区域样式 */
.ant-layout-content {
  margin: 16px;
  padding: 24px;
  min-height: calc(100vh - 112px);
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
}

/* 卡片样式 */
.ant-card {
  border-radius: 8px;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03);

  &-head {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  }

  &-bordered {
    border: 1px solid rgba(0, 0, 0, 0.06);
  }
}

/* 按钮样式 */
.ant-btn {
  border-radius: 6px;
  font-weight: 500;

  &-primary {
    box-shadow: 0 2px 0 rgba(5, 145, 255, 0.1);
  }
}

/* 表格样式 */
.ant-table {
  border-radius: 8px;
  overflow: hidden;

  &-container {
    border: 1px solid rgba(0, 0, 0, 0.06);
  }

  &-thead > tr > th {
    background-color: #fafafa;
    font-weight: 600;
  }
}

/* 表单样式 */
.ant-form {
  &-item {
    margin-bottom: 16px;

    &-label > label {
      font-weight: 500;
    }
  }

  &-large .ant-form-item-label > label {
    font-size: 14px;
  }
}

/* 输入框样式 */
.ant-input,
.ant-input-number,
.ant-select-selector {
  border-radius: 6px;
}

/* 标签页样式 */
.ant-tabs {
  &-top > .ant-tabs-nav {
    margin: 0;
  }

  &-tab {
    font-weight: 500;
    padding: 12px 16px;
  }

  &-ink-bar {
    height: 3px;
    border-radius: 3px;
  }
}

/* 徽标样式 */
.ant-badge {
  &-count {
    box-shadow: 0 0 0 1px #fff;
  }
}

/* 下拉菜单样式 */
.ant-dropdown-menu {
  border-radius: 8px;
  box-shadow: 0 6px 16px 0 rgba(0, 0, 0, 0.08),
    0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);

  &-item {
    padding: 8px 16px;
    font-weight: 400;
  }
}

/* 面包屑导航样式 */
.ant-breadcrumb {
  padding: 16px 24px;
  background: #fff;

  a {
    color: rgba(0, 0, 0, 0.45);

    &:hover {
      color: #1677ff;
    }
  }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .ant-layout-sider {
    position: fixed;
    height: 100vh;
    z-index: 100;
  }

  .ant-layout {
    margin-left: 0;
  }

  .ant-layout-content {
    margin: 16px 8px;
    padding: 16px;
  }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;

  &:hover {
    background: rgba(0, 0, 0, 0.25);
  }
}

/* 工具类 */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.full-height {
  height: 100%;
}

.text-center {
  text-align: center;
}

.mt-16 {
  margin-top: 16px;
}

.mb-16 {
  margin-bottom: 16px;
}

.p-16 {
  padding: 16px;
}

/* 暗黑模式适配 */
[data-theme="dark"] {
  .ant-layout {
    background-color: #141414;
  }

  .ant-layout-sider {
    background-color: #1f1f1f;
  }

  .ant-layout-header {
    background-color: #1f1f1f;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  }

  .ant-layout-content {
    background-color: #1f1f1f;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  }

  .ant-card {
    background-color: #1f1f1f;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  }
}
